#include "BulletState.h"

BulletState::BulletState(int posX, int posY,int angl, string nameObj) : SceneObjectState(nameObj)
{
	setAngle(angle);
	setSpeed(8);
	//this->angularSpeed = 0;
	setRotation(false);
}
//------------------------------------------------------------------------------
BulletState::~BulletState(void)
{
}
//------------------------------------------------------------------------------
void BulletState::setRotation(bool flag)
{
	this->rotation = flag;
}
//------------------------------------------------------------------------------
bool BulletState::getRotation(){
	return this->rotation;
}
//------------------------------------------------------------------------------
void BulletState::setAngle(int angle)
{
	this->angle = angle;
}
//------------------------------------------------------------------------------
int BulletState::getAngle(){
	return this->angle;
}
//------------------------------------------------------------------------------
void BulletState::setSpeed(int speed)
{
	this->speed = speed;
}
//------------------------------------------------------------------------------
int BulletState::getSpeed(){
	return this->speed;
}
//------------------------------------------------------------------------------
void BulletState::rotate(){
	this->angle = angle % 360;
	rotation=true;
}
//------------------------------------------------------------------------------
//void BulletState::move(SceneState* s)
//{
//	int x = getX();
	//int y = getY();

	//int incx = (int)(getSpeed() * sinf((float)(getAngle() * M_PI / 180)));
	//int incy = (int)(getSpeed() * cosf((float)(getAngle() * M_PI / 180)));

	//y += incy;
	//x += incx;
	//if (s->ocurredInside(x,y))
	//{
	//	setXCoordinate(x);
	//	setYCoordinate(y);
	//}
	//else
	//	 setAlive(false);
//}
//==============================================================================
